package org.subside.List;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.IterableMap;
import org.subside.List.pojo.Person;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author : zhangbo
 * @data : 2024/6/12
 * @description :
 */
public class test {
    public static void main(String[] args) {
        Person person=new Person();
        person.setAge(18);
        person.setName("zhangsan");
        person.setSex("1");
        person.setSalary(18000);
        person.setArea("chengdu");
        Object json = JSONObject.toJSON(person);
        System.out.println(json);

        List<Map<String ,Object>>list=new ArrayList<>();
        List<Map<String ,Object>>tmplist=new ArrayList<>();
        Map<String,Object>map=new HashMap<>();
        map.put("name","zhangsan");
        map.put("age",18);
        map.put("area","beijing");
        tmplist.add(map);
        list.addAll(tmplist);
        for (Map<String, Object> map1 : list) {
            String name = String.valueOf(map1.get("name"));
            System.out.println(name);
        }
        list.stream().forEach(a->{
            String name =String.valueOf(a.get("name"));
            System.out.println(name);
        });
    }
}
